package com.tlkj.common.curd.liquibase;


import liquibase.integration.spring.SpringLiquibase;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

public class LiquibaseConfig {

    /**
     * 初始化liquibase
     * @param dataSource
     * @return
     */
    @Bean
    public SpringLiquibase liquibase(DataSource dataSource){
        SpringLiquibase liquibase = new SpringLiquibase();
        liquibase.setDataSource(dataSource);
        liquibase.setChangeLog("classpath:changelog/common-curd/changelog-master.xml");
        liquibase.setShouldRun(true);
        return liquibase;
    }

}
